package com.example.mrzhou.lvmm.view.fragment.destination;


import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.EditText;

import com.example.mrzhou.lvmm.R;
import com.example.mrzhou.lvmm.commom.base.BaseFragment;
import com.example.mrzhou.lvmm.commom.utils.FragmentViewPagerUtils;
import com.example.mrzhou.lvmm.entity.destination.DesSendMsg;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * A simple {@link Fragment} subclass.
 */
public class DestinationFragment extends BaseFragment {


    @BindView(R.id.et_destination_search)
    EditText etDestinationSearch;
    @BindView(R.id.tab_distination)
    TabLayout tabDistination;
    @BindView(R.id.vp_distination)
    ViewPager vpDistination;

    private List<Fragment> fragments = new ArrayList<>();
    public static final String[] TITLE_DES = {"国外", "国内", "主题"};

    public DestinationFragment() {
        // Required empty public constructor
    }

    public static DestinationFragment newInstance() {

        Bundle args = new Bundle();

        DestinationFragment fragment = new DestinationFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected int getLayout() {
        return R.layout.fragment_destination;
    }

    @Override
    protected void initView(View view) {
        ButterKnife.bind(this, view);
        initData();
    }

    @Override
    protected void initData() {
        fragments.add(DesSampleFragment.newInstance(new DesSendMsg("1477743040649", "0c77c41e97c4604485775d66daf95852", "MDD_GW")));
        fragments.add(DesSampleFragment.newInstance(new DesSendMsg("1477743160213", "a9c8e8af7ccf7640e4984c00903c0e1f", "MDD_GN")));
        fragments.add(DesSampleFragment.newInstance(new DesSendMsg("1477743216154", "94a6026cdb5e6304f57207fc68cb356f", "MDD_ZT")));
        FragmentViewPagerUtils utils = new FragmentViewPagerUtils();
        utils.fragmentVpUtils(fragments, TITLE_DES, vpDistination, tabDistination, getChildFragmentManager());
    }

}
